Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: get content for user #226

Merged
merged 2 commits into from
Jul 1, 2024
Merged

feat: get content for user #226

merged 2 commits into from
Jul 1, 2024

Conversation

tdstein
Copy link
Collaborator

@tdstein tdstein commented Jun 17, 2024

Adds scoped content calls off of the User resource (e.g., client.users.find_one().content.find_one().

Copy link

github-actions bot commented Jun 17, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1097 1028 94% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
src/posit/connect/content.py 100% 🟢
src/posit/connect/users.py 100% 🟢
TOTAL 100% 🟢

updated for commit: f8bfbd0 by action🐍

Copy link
Collaborator

@toph-allen toph-allen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments, just questions, mostly for my own comprehension.

Comment on lines +14 to +17
@classmethod
def teardown_class(cls):
cls.item.delete()
assert cls.client.content.count() == 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm new to the architecture of this package — for my own learning, what does this do?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cls.item is the content item created in the setup_class method. L16 performs a delete action, and L17 asserts that the total number of content items on the server is 0. The user used for testing has administrator privileges.

The general idea here is to try and ensure a "clean" server state between test classes. That way, other test classes would not need to be aware of each other. I'm not sure this is viable in the long term, but it's okay for now.

src/posit/connect/users.py Outdated Show resolved Hide resolved
@tdstein tdstein merged commit c927af0 into main Jul 1, 2024
29 checks passed
@tdstein tdstein deleted the tdstein/180 branch July 1, 2024 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants